#编写程序，爬取萍乡学院官网的页面信息，将爬取到的页面保存到“D:\\萍乡学院.html”
import requests
from bs4 import BeautifulSoup

if __name__ == "__main__":
    url="http://www.pxc.jx.cn/";
    headers = {
        'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36'
    };
    resp=requests.get(url=url,headers=headers);
    resp.encoding="utf-8";
    bs4=BeautifulSoup(resp.text);
    print(bs4);
    fb=open("D:\\萍乡学院.html","lxml",encoding="utf-8");
    fb.write(bs4);
